import { Component, OnInit } from '@angular/core';
import { NzMessageService, NzModalRef } from 'ng-zorro-antd';
import { SFSchema } from '@delon/form';
@Component({
  selector: 'app-work-card-edit',
  templateUrl: './edit.component.html',
})
export class BusinessWorkCardEditComponent implements OnInit {
  i: any = {};
  accountInfo: string = '新增工牌';
  schema: SFSchema = {
    properties: {
      title: {type: 'string',title: '名称'},
      projector: {type: 'string',title: '设计师'},
      style: {type: 'string',title: '样式'},
      status: {
        type: 'string',
        title: '状态',
        enum: [
          { value: '使用中', label: '使用中' },
          { value: '储备', label: '储备' }
        ]
      },
      remark: {type: 'string',title: '备注'}
    },
    required: ['title', 'projector', 'style', 'status'],
    ui: {
      spanLabelFixed: 80,
      grid: { span: 24 },
    },
  };
  constructor(private modal: NzModalRef, private msgSrv: NzMessageService) {}
  ngOnInit() {
    if(this.i._id) {
      this.accountInfo = '修改工牌'
    }
  }
  save(value: any) {
    // this.msgSrv.success('保存成功');
    value.initiator = '袁巧';
    this.modal.close(value);
  }
  close() {
    this.modal.destroy();
  }
}
